export default class User {

    id
    name
    gender
    username
    password
    signature
    imgUrl
    likeCount
    reportCount
    learnTime
    email

    constructor(id, username, password, email, name, gender, signature, imgUrl, likeCount, reportCount, learnTime) {
        if (!id || !username || !password || !email) {
            throw new Error("无效的用户信息")
        }
        this.id = id
        this.name = name || ("用户" + Math.floor(Math.random() * 999999))
        this.gender = gender || 3
        this.username = username
        this.password = password
        this.signature = signature || "该用户只想抽个时间睡大觉"
        this.imgUrl = imgUrl || "/statics/upload/user/default-user.png"
        this.likeCount = likeCount || 0
        this.reportCount = reportCount || 0
        this.learnTime = learnTime || 0
    }
}